<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增词组详情')" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-cizu-add">
           <div class="form-group">    
                <label class="col-sm-2 control-label">词组：</label>
                <div class="col-sm-10">
                    <input name="w" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label">pinyin：</label>
                <div class="col-sm-10">
                    <input name="p" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label">同义词：</label>
                <div class="col-sm-10">
                    <input name="t" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label">反义词：</label>
                <div class="col-sm-10">
                    <input name="f" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">解释：</label>
                <div class="col-sm-10">
                    <input id="d" name="d" type="hidden">
                    <div id="editor" class="summernote"></div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: summernote-js" />
    <script type="text/javascript">
        var prefix = ctx + "dict/cizu"
        
        $(function() {
		    $('.summernote').summernote({
		    	placeholder: '请输入内容',
		    	height : 400,
				lang : 'zh-CN',
				followingToolbar: false,
				callbacks: {
	                onImageUpload: function (files) {
	                    
	                }
	            }
		    });
			var content = $("#d").val();
		    $('#editor').summernote('code', content);
	    });
        
        $("#form-cizu-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
            	var sHTML = $('.summernote').summernote('code');
				$("#d").val(sHTML);
                $.operate.save(prefix + "/add", $('#form-cizu-add').serialize());
            }
        }
    </script>
</body>
</html>